﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="edit_bill_form.aspx.cs" Inherits="SQT.tracnghiem.Ajax.ASP.Accountant.edit_bill" %>

<%@ Import Namespace="DataAccess" %>
<!DOCTYPE html>

<html xmlns="http://www.w3.org/1999/xhtml">

<body>
    <%
        var get_bill = new TblStudyFeeController().FetchAll().Where(x => x.Id == this.id).Single();
        var get_user = new TblUserController().FetchAll().Where(x => x.UserId == get_bill.UserId).Single();
        var get_class = new TblClassController().FetchAll().Where(x => x.Id == get_user.ClassX).Single();
        string exp_date = DateTime.Parse(get_bill.ExpDate.ToString()).Year.ToString() + "-";
        if (DateTime.Parse(get_bill.ExpDate.ToString()).Month < 10)
            exp_date += "0"+ DateTime.Parse(get_bill.ExpDate.ToString()).Month.ToString() + "-";
        else
            exp_date += DateTime.Parse(get_bill.ExpDate.ToString()).Month.ToString() + "-";
        if (DateTime.Parse(get_bill.ExpDate.ToString()).Day < 10)
            exp_date += "0" + DateTime.Parse(get_bill.ExpDate.ToString()).Day.ToString();
        else
            exp_date += DateTime.Parse(get_bill.ExpDate.ToString()).Day.ToString();
    %>
    <div class="w3-hide" id="edit_bill_id"><%=get_bill.Id %></div>
    <div class="w3-row w3-center w3-text-red" id="edit_error_msg"></div>
    <div class="w3-row w3-padding-bottom">
        <span class="w3-col l3">Mã HV</span><input class="w3-half w3-border w3-border-teal" type="text" disabled="disabled" value="<%=get_user.NumberStudy.ToUpper() %>" />
    </div>
    <div>
        <div class="w3-row w3-padding-bottom">
            <span class="w3-col l3">Họ tên</span><input class="w3-half w3-border w3-border-teal" type="text" value="<%=get_user.FullName %>" disabled="disabled" />
        </div>
        <div class="w3-row w3-padding-bottom">
            <span class="w3-col l3">Lớp</span><input class="w3-half w3-border w3-border-teal" type="text" value="<%=get_class.ClassName %>" disabled="disabled" />
        </div>
        <div class="w3-row w3-padding-bottom">
            <span class="w3-col l3">Học phí</span><input id="edit_fee" class="w3-half w3-border w3-border-teal" type="number" min="0" step="50000" value="<%=get_bill.Fee %>" />
        </div>
        <div class="w3-row w3-padding-bottom">
            <span class="w3-col l3">Gói</span>
            <select id="edit_packet" class="w3-half w3-border w3-border-teal">
                <%for (int i = 1; i <= 3; i++)
                  {
                      if (i == get_bill.Packet)
                      { %>
                <option value="<%=i %>" selected="selected"><%=i %> tháng</option>
                <%}
                      else
                      {
                %>
                <option value="<%=i %>"><%=i %> tháng</option>
                <%
                      }
                  } %>
            </select>
        </div>
        <div class="w3-row w3-padding-bottom">
            <span class="w3-col l3">Ngày hết hạn</span><input id="edit_date" class="w3-half w3-border w3-border-teal" type="date" value="<%=exp_date %>" />
        </div>
        <div class="w3-row w3-center">
            <a class="w3-btn w3-teal" id="btn_edit_bill"><i class="fa fa-check"></i>&nbsp;Xác nhận</a>&nbsp;
            <a id="btn_accept_del_bill" class="w3-btn w3-red"><i class="fa fa-trash"></i>&nbsp;Xóa</a>
            <a onclick="document.getElementById('edit-study-pay-modal').style.display = 'none'" class="w3-btn w3-teal"><i class="fa fa-times"></i>&nbsp;Hủy</a>
        </div>
    </div>
</body>
</html>
